// var Movie = {
// 	template:'#movie'
// }

var Home = {
    template: '#home',
    data:function() {
        return {
            lunbo:'',
            zhengzai:'',
            jijiang:''
        }
    },
    methods: {
    },
    mounted: function() {
        var that = this;
                $.get('http://10.20.159.13:3000/lunbo', function(res) {
                    // console.log(res.data.billboards)
                    that.lunbo = res.data.billboards
                })
        $.get('http://10.20.159.13:3000/zhengzai', function(res) {
            that.zhengzai = res.data.films
                //处理时间戳的方法
                // console.log(res.data.films[1].premiereAt)
                // var date =$.myTime.UnixToDate(res.data.films[1].premiereAt,"Y-m-d H:i:s",'')
                // console.log(date)
               })
        $.get('http://10.20.159.13:3000/jijiang', function(res) {
                    // console.log(res)
                    that.jijiang = res.data.films
                })
        setTimeout(function(){
        	 new Swiper('.swiper-container', {
                direction: 'horizontal',
                loop: true,
                autoplay: 4500,
               	speed: 1000,
                autoplayDisableOnInteraction: false
        	})
        }, 2000);
    }
}

var Movie = {
	template:'#movie'
}
// var Home = {
// 	template:'#home'
// }
var routes = [
	{
	    path: '/home',
	    component: Home
	}, 
	{
		path:'/movie',
		component:Movie
	},
	{
	    path: '*',
	    redirect: '/home'
	}
]

var router = new VueRouter({
    routes: routes
})
